<?php
/*
 * 心情前台控制器
 * @author suosuo
 */
 namespace Home\Controller;
 use Think\Controller;

 class MoodController extends  CommonController {
 	
//	列表
 	public function index ()  {
 		
		$conds = array();
		
		$page = $_REQUEST['p'] ? $_REQUEST['p'] : 1;
		$pageSize = 8;//每页显示数量
		$conds['status'] = array('neq',-1);
		$moods = D('Mood')->getMoods($conds,$page,$pageSize);
		$count = D('Mood')->getMoodsCount($conds);
		$res = new \Think\Page($count,$pageSize);
		$pagers = $res->show();
		$this->assign('pagers',$pagers);
		$this->assign('moods',$moods);
		$this->display();
 	}

	
 }